l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
if AddLibrary("rexxsupport.library","rxsocket.library","rxwiz.library")~=0 then exit
if ~IsLibOn("SOCKET") then do
call EasyRequest("No TCP/IP stack is running."d2c(10)"A bsdsocket.library compatible"d2c(10)"internet stack must be started"d2c(10)"before you can run hserv.")
exit
end
global.cat="quickstart.catalog"
call pragma("D",PathPart(ProgramName("FULL")))
s.snapshot=1
s.catalog=global.cat
res=OpenSurface("QuickStart.wizard","S")
if res~=0 then exit
w.ID=1
w.Gads=16
res=OpenWindow("S","W")
say res
if res~=0 then exit
global.ws=WindowSignal("S","W")
global.file="/conf/hserv.conf"
global.port=80
call getStrings
global.0=global.str.CANTFIND
global.1=global.str.RUNNING
global.2=global.str.NOSERVER
global.status=""
call setGadgets
stop=0
ctrl_c=2**12
swait=or(global.ws,ctrl_c)
do while ~stop
srec=Wait(swait,1)
if and(srec,ctrl_c)~=0 then call break_c
if and(srec,global.ws)~=0 then stop=handleObj("W")